{% extends 'base.html' %}
{% load staticfiles %}


{% block content %}

<div class="col-sm-9 col-sm-offset-3 col-md-10 col-md-offset-2 main">
    {%if msg%}
    <div class="alert alert-danger">
        <strong>{{msg}}</strong>
    </div>
    {%endif%}
    {%if s_msg%}
    <div class="alert alert-success">
        <strong>{{s_msg}}</strong>
    </div>
    {%endif%}
    <div>
        <div>
            <h2>房间查询</h2>
            <form class="form-horizontal" method="POST" action="/check_out">
                <div class="form-group">
                    <label for="inputEmail3" class="col-sm-2 control-label">顾客姓名</label>
                    <div class="col-sm-5">
                        <input type="text" class="form-control" name="name" id="inputEmail3">
                    </div>
                </div>
                {% csrf_token %}
                <div class="form-group">
                    <div class="col-sm-offset-2 col-sm-2">
                        <button type="submit" class="btn btn-primary">查询</button>
                    </div>
                </div>
            </form>
            {%if data%}
            <h2>订单详情</h2>
            <form class="form-horizontal" method="POST" action="/check_out">
                <div class="form-group">
                    <label for="inputEmail3" class="col-sm-2 control-label">姓名</label>
                    <div class="col-sm-5">
                        <input type="text" class="form-control" name="name" id="inputEmail3" readonly
                            value="{{data.name}}">
                    </div>
                </div>
                <div class="form-group">
                    <label for="inputEmail3" class="col-sm-2 control-label">房间号</label>
                    <div class="col-sm-5">
                        <input type="text" class="form-control" name="room_num" id="inputEmail3" readonly
                            value="{{data.room_num}}">
                    </div>
                </div>
                <div class="form-group">
                    <label for="inputEmail3" class="col-sm-2 control-label">房间类型</label>
                    <div class="col-sm-5">
                        <input type="text" class="form-control" name="room_type" id="inputEmail3" readonly
                            value="{{data.room_type}}">
                    </div>
                </div>
                <div class="form-group">
                    <label for="inputPassword3" class="col-sm-2 control-label">房间状态</label>
                    <div class="col-sm-5">
                        <input type="text" class="form-control" name="room_status" id="inputPassword3" readonly
                            value="{{data.room_status}}">
                    </div>
                </div>
                <div class="form-group">
                    <label for="inputEmail3" class="col-sm-2 control-label">入住人数</label>
                    <div class="col-sm-5">
                        <input type="text" class="form-control" name="people" id="inputEmail3" readonly
                            value="{{data.people_num}}">
                    </div>
                </div>
                <div class="form-group">
                    <label for="inputEmail3" class="col-sm-2 control-label">入住时间</label>
                    <div class="col-sm-5">
                        <input type="text" class="form-control" name="s_time" id="inputEmail3" readonly
                            value="{{data.s_time|date:'Y-m-d'}}">
                    </div>
                </div>
                <div class="form-group">
                    <label for="inputEmail3" class="col-sm-2 control-label">离开时间</label>
                    <div class="col-sm-5">
                        <input type="text" class="form-control" name="e_time" id="inputEmail3" readonly
                            value="{{data.e_time|date:'Y-m-d'}}">
                    </div>
                </div>
                {% csrf_token %}
                <input type="hidden" name='check_out' value='1'>
                <div class="form-group">
                    <div class="col-sm-offset-2 col-sm-2">
                        <button type="submit" class="btn btn-primary">退房</button>
                    </div>
                </div>
            </form>
            {%endif%}
        </div>
    </div>

</div>
<script src="/static/calendar/WdatePicker.js"></script>
{% endblock %}